﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for Orders
/// </summary>
public class Orders
{
    public int Order_id { get; set; }
    public int User_id { get; set; }
    public float Price { get; set; }
    public string Address { get; set; }
    public string Phone { get; set; }
    public string Email { get; set; }
    public string Description { get; set; }
    public bool Status { get; set; }
    public DateTime DateStart { get; set; }
    public DateTime DateUpdate { get; set; }
    public string Fullname { get; set; }
    public string Username { get; set; }
	public Orders()
	{
	    this.Order_id = 0;
	    this.User_id = 0;
	    this.Price = 0;
	    this.Address = "";
	    this.Phone = "";
	    this.Email = "";
	    this.Description = "";
	    this.Status = true;
	    this.DateStart = DateTime.Now;
	    this.DateUpdate = DateTime.Now;
	    this.Fullname = "";
	    this.Username = "";
	}
    public Orders(DataRow dr)
    {
        this.Order_id = Convert.ToInt32(dr[0].ToString());
        this.User_id = Convert.ToInt32(dr[1].ToString());
        this.Price = Convert.ToInt32(dr[2].ToString());
        this.Address = dr[3].ToString();
        this.Phone = dr[4].ToString();
        this.Email = dr[5].ToString();
        this.Description = dr[6].ToString();
        this.Status = Boolean.Parse(dr[7].ToString());
        this.DateStart = DateTime.Parse(dr[8].ToString());
        if (dr[9].ToString() != "" && dr[9].ToString()!=null)
            this.DateUpdate = DateTime.Parse(dr[9].ToString());
        this.Fullname = dr[10].ToString();
        this.Username = dr[10].ToString();
    }
}